home *** CD-ROM | disk | FTP | other *** search
/ Game Cracker (Expanded Edition) / Game Cracker (Expanded Edition).iso / cracks / M&M-CRK1.ZIP / CRACK.DOC next >
Text File  |  1999-02-14  |  9KB  |  220 lines

  1.  
  2. Ok, I'm a novice cracker, 'cause usually you find the cracks to all
  3. the games on the net. But this cool game was nowhere to find.
  4. I suspected a title change for the european version but nothing
  5. to find anywhere.
  6.  
  7. It's the game Magic & Mayhem from Mythos.
  8.  
  9. And since I have to put a lot of time into cracking this thing, I'll
  10. let you read along so you might do your own crack next.
  11.  
  12. ------------------
  13.  
  14. 1) Ok welcome. First of all we have to know if a game is really protected.
  15.    To do this, we try to make an as good as possibly CD copy of the 
  16.    original.
  17.  
  18.    I did, and after putting in the CD it complained with a window if I
  19.    wanted to run a multiplayer version, retry or abort.
  20.  
  21.    So it's protected.
  22.  
  23.  
  24. 2) We start up WDASM32 and decompile the chaos.exe file.
  25.    This takes a while..
  26.    
  27. 3) I wrote down what the game says when it runs into a copied cd.
  28.    So we're going to search for the error message with the 
  29.    'String Data References` menu. But nothing turns up, no 
  30.    matter what we look for.
  31.    
  32. 4) Ok let's think about what we know. It's data from CD it uses for
  33.    the protection scheme. So let's go look for 'drivetype' with the
  34.    'Find text' button.
  35.    
  36.    We get 'GetDriveTypeA' in the list of functions used, click 
  37.    'Find next' and wait a bit..
  38.    
  39. 5) Ok here we go.. a hit on address 0047BE54.
  40.    The piece of code is below..
  41.  
  42.      * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  43.      |:0047BF5D(C), :0047BF68(C), :0047BF73(C)
  44.      |
  45.      :0047BE47 8BBC241C010000          mov edi, dword ptr [esp+0000011C]
  46.      :0047BE4E C644241300              mov [esp+13], 00
  47.      :0047BE53 57                      push edi
  48.      
  49.      * Reference To: KERNEL32.GetDriveTypeA, Ord:0104h
  50.                                        |
  51.      :0047BE54 FF157C305A00            Call dword ptr [005A307C]
  52.      :0047BE5A 83F805                  cmp eax, 00000005
  53.      :0047BE5D 0F85FA010000            jne 0047C05D
  54.      :0047BE63 8B953C030000            mov edx, dword ptr [ebp+0000033C]
  55.      :0047BE69 8D8D7C030000            lea ecx, dword ptr [ebp+0000037C]
  56.      :0047BE6F 51                      push ecx
  57.      :0047BE70 6802010000              push 00000102
  58.      :0047BE75 6814080000              push 00000814
  59.      :0047BE7A 52                      push edx
  60.      :0047BE7B C7858403000001000000    mov dword ptr [ebp+00000384], 00000001
  61.      :0047BE85 FFD3                    call ebx
  62.      :0047BE87 85C0                    test eax, eax
  63.      :0047BE89 0F85CE010000            jne 0047C05D
  64.      :0047BE8F 8A8580030000            mov al, byte ptr [ebp+00000380]
  65.      :0047BE95 83F84B                  cmp eax, 0000004B
  66.      :0047BE98 7409                    je 0047BEA3
  67.      :0047BE9A 83F84C                  cmp eax, 0000004C
  68.      :0047BE9D 0F85BA010000            jne 0047C05D
  69.      
  70.      * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  71.      |:0047BE98(C)
  72.      |
  73.      :0047BEA3 83C9FF                  or ecx, FFFFFFFF
  74.      :0047BEA6 33C0                    xor eax, eax
  75.      :0047BEA8 F2                      repnz
  76.      :0047BEA9 AE                      scasb
  77.      :0047BEAA F7D1                    not ecx
  78.      :0047BEAC 2BF9                    sub edi, ecx
  79.      :0047BEAE 8D542418                lea edx, dword ptr [esp+18]
  80.      :0047BEB2 8BC1                    mov eax, ecx
  81.      :0047BEB4 8BF7                    mov esi, edi
  82.      :0047BEB6 8BFA                    mov edi, edx
  83.      
  84. 6) Ok, this looks like a good place to start. We look up the
  85.    'GetDriveTypeA' function in the Windows API guide.
  86.  
  87.    The function returns '5' when the drive is a CD drive.
  88.  
  89.      :0047BE5A 83F805                  cmp eax, 00000005
  90.      
  91.    Hmm looks like it is looking for a CD drive, so we might be
  92.    on the right track.
  93.    
  94. 7) Let's look on ahead. If it's not a CD drive it jumps somewhere.
  95.    But we assume that this is the protection scheme. So we read on,
  96.    and don't follow the jump.
  97.     
  98.    It moves some addresses and data around, calls something and goes
  99.    on to test the result of that call.
  100.    
  101. 8) Ok now we are ready to go and see what goes on there. So we do
  102.    a 'Load Process' from the debug menu. We go to the address
  103.    where we're working on, and select where to break.
  104.  
  105.      :0047BE87 85C0                    test eax, eax
  106.  
  107.    I put a break on here so we can see what the three checks do after
  108.    the call.
  109.    
  110. 9) Put in the original CD and hit 'Run program'. After only a few seconds
  111.    the program pauses and we go back to WDASM. We're on our location.
  112.    Now hit F7 a few times and see where it goes.
  113.    
  114.      :0047BE95 83F84B                  cmp eax, 0000004B
  115.      :0047BE98 7409                    je 0047BEA3
  116.  
  117.    It jumps away on the second check.
  118.    
  119. 10) Terminate the process, put in the CD copy, and run the program again.
  120.  
  121. 11) It stops on the same place. Hit F7 a few times.
  122.  
  123. 12) Hey! It doesn't go where it went the first time. AX contains
  124.     4A instead of 4B. So it does look like this is the place where
  125.     the copy scheme is implemented.
  126.     
  127. 13) Ok, let's go crack it! Let's NOP (90h) all these commands, so it
  128.     runs into 0047BEA3 automatically.
  129.  
  130.      :0047BE89 0F85CE010000            jne 0047C05D
  131.      :0047BE8F 8A8580030000            mov al, byte ptr [ebp+00000380]
  132.      :0047BE95 83F84B                  cmp eax, 0000004B
  133.      :0047BE98 7409                    je 0047BEA3
  134.      :0047BE9A 83F84C                  cmp eax, 0000004C
  135.      :0047BE9D 0F85BA010000            jne 0047C05D
  136.  
  137. 14) Patch the chaos.exe file, and start it.
  138.  
  139. 15) Hey! No go! :( Why not? 
  140.  
  141.     Let's see, it compares with something in the memory at location
  142.     ebp+380h. So we run the program again with the original CD and
  143.     with the CD copy. When it breaks we investigate the memory
  144.     at the ebp+380h location. We write down the following.
  145.     
  146.       Original:  4B 24 17 00 01 00 00 00 00 00 00 00 45 3A 00
  147.       Copy    :  4A 33 15 00 01 00 00 00 00 00 00 00 45 3A 00
  148.       
  149.     Looks like there are 3 bytes different from the original CD.
  150.     
  151. 16) The idea is to write those 3 bytes in the memory, and we can
  152.     do that at the place where we're nopping out all those
  153.     instructions. I think there are other checks that inspect
  154.     that piece of memory.
  155.  
  156. 17) It'll look something like this after you edited the chaos.exe
  157.     file.
  158.  
  159.      :0047BE6F 51                      push ecx
  160.      :0047BE70 6802010000              push 00000102
  161.      :0047BE75 6814080000              push 00000814
  162.      :0047BE7A 52                      push edx
  163.      :0047BE7B C7858403000001000000    mov dword ptr [ebp+00000384], 00000001
  164.      :0047BE85 FFD3                    call ebx
  165.      :0047BE87 C785800300004B241700    mov dword ptr [ebp+00000380], 0017244B
  166.      :0047BE91 90                      nop            
  167.      :0047BE92 90                      nop            
  168.  
  169.         <snip>
  170.  
  171.      :0047BEA1 90                      nop            
  172.      :0047BEA2 90                      nop            
  173.      
  174.      * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  175.      |:0047BE98(C)
  176.      |
  177.      :0047BEA3 83C9FF                  or ecx, FFFFFFFF
  178.      :0047BEA6 33C0                    xor eax, eax
  179.      :0047BEA8 F2                      repnz
  180.  
  181. 18) You'll have to add the 
  182.  
  183.      :0047BE87 C785800300004B241700    mov dword ptr [ebp+00000380], 0017244B
  184.  
  185.     part yourself.
  186.       
  187. 19) Pop in the CD copy, and start the program.
  188.  
  189. 20) YES! IT WORKS :)
  190.     But it seems a bit sluggish.. Maybe because my audio tracks on my 
  191.     CD aren't 100% (You need an 80 minute CD for a good copy)
  192.     
  193. 21) So we quit the game, remove all CD's and start the chaos.exe file.
  194.     Nope, we get another error message.
  195.     
  196. 22) Let's start to remove all the nonsense we don't need. Also let's
  197.     try to nop out the call and see if it all still works.
  198.  
  199. 23) Yes it does.. The game speeds up, and the only difference we notice
  200.     is the short timeouts we have during the start of a game, when
  201.     commands are send to the CD drive to start an audio track.
  202.  
  203.     Just nop out everything after the point where functions jump into.
  204.  
  205.      * Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
  206.      |:0047BF5D(C), :0047BF68(C), :0047BF73(C)
  207.      |
  208.      :0047BE47 90                      nop                              
  209.  
  210.     And DON'T FORGET to leave our command in there to write those bytes
  211.     to avoid other places where it might be checked.
  212.  
  213. 24) Ok we're done :) Took be a bit to figure all of this out, but I'm
  214.     happy with it. Something I can be happy with to have achived.
  215.  
  216.  
  217. MR CUR$0R 02/1999
  218.  
  219.  
  220.